package com.google.jessewilson.codesearch.api;

/**
 * Contains the search-results snippet (the code lineValue containing the match).
 * The type attribute indicates the format of the text; type="html" indicates
 * that . The lineNumber attribute indicates
 *
 * @author jessewilson
 */
public final class Line {

  private CodeFile codeFile;
  private String lineValue;
  private int lineNumber;

  /**
   * The code file that this line belongs to.
   */
  public CodeFile getCodeFile() {
    return codeFile;
  }

  public void setCodeFile(CodeFile codeFile) {
    this.codeFile = codeFile;
  }

  /**
   * Get the code containing the match.
   */
  public String getLineValue() {
    return lineValue;
  }

  public void setLineValue(String lineValue) {
    this.lineValue = lineValue;
  }

  /**
   * the line where the match happened, starting at zero.
   */
  public int getLineNumber() {
    return lineNumber;
  }

  public void setLineNumber(int lineNumber) {
    this.lineNumber = lineNumber;
  }


  public String toString() {
    return codeFile + "#" + lineNumber;
  }
}
